package com.hdmall.business.common.util;

import com.hdmall.business.common.common.ServerResponse;

public class AgentUtil {


    //暂时只有PC，IOS，ANDROID
    private static final String  [] TYPES = {"PC-", "IOS-", "ANDROID-", "WECHAT-", "XTXIOS-","XTXANDROID-"};

    public static  ServerResponse<String> deleteAgentUserName(String agentUserName) {
        String [] temp = agentUserName.split("-");
        //用户名（手机号）
        String username = null;
        //设备类型
        String type = null;

        for (String TYPE : TYPES) {
            if ((temp[0] + "-").equals(TYPE)) {
                System.out.println("1111"+TYPE);
                username = agentUserName.substring(TYPE.length() , agentUserName.length() );
                type = TYPE;
                break;
            }
        }

        System.out.println("****"+temp[0]);
        System.out.println("****"+username);
        return ServerResponse.createBySuccess(type + ":" + username);
    }


}
